2-2

The Dynamical Action Function

Nicholas Wheeler
Reed College Physics Department
7 October 2008

Free   Particle

Clear[x,L]

The Lagrangian reads

L=(1/2)m ((x'[t])^2);

so the Lagrange equation is simply

m x''[t]=0

DSolve[{x''[t]==0, x[t1]==x1, x[t2]==x2},x[t],t]

((t x1-t2 x1-t x2+t1 x2)/(t1-t2))==x1+((x2-x1)/(t2-t1))(t-t1)//Simplify

Clear[x]

x[t_]:=x1+((x2-x1)/(t2-t1))(t-t1)

m x''[t]==0
x[t1]==x1
x[t2]==x2

(∫_t1^t2)L\[DifferentialD]t

SFree[x1_,t1_,x2_,t2_]:=((m (((x2-x1))^2))/(2 (t2-t1)))

Harmonic Oscillator

Clear[x,L]

The Lagrangian reads

L=(1/2)m( ((x'[t])^2)-(ω^2)((x[t])^2));

DSolve[{x''[t]+(ω^2)x[t]==0, x[t1]==x1, x[t2]==x2},x[t],t]//Simplify

Csc[(t1-t2) ω] (-x2 Sin[(t-t1) ω]+x1 Sin[(t-t2) ω])==((x1 Sin[(t2-t) ω]+x2 Sin[(t-t1) ω])/(Sin[ω(t2-t1)]))//Simplify

x[t_]:=((x1 Sin[(t2-t) ω]+x2 Sin[(t-t1) ω])/(Sin[ω(t2-t1)]))

x''[t]+(ω^2) x[t]==0//Simplify
x[t1]==x1
x[t2]==x2

(∫_t1^t2)L\[DifferentialD]t//FullSimplify

(1/2) m ω (((x1^2)+(x2^2)) Cot[(-t1+t2) ω]+2 x1 x2 Csc[(t1-t2) ω])==((m ω)/(2 Sin[ω(t2-t1)]))(((x1^2)+(x2^2))Cos[ω(t2-t1)]-2x1 x2)//Simplify

SOscillator[x1_,t1_,x2_,t2_]:=((m ω)/(2 Sin[ω(t2-t1)]))(((x1^2)+(x2^2))Cos[ω(t2-t1)]-2x1 x2)

Limit[SOscillator[x1,t1,x2,t2],ω->0]==SFree[x1,t1,x2,t2]//Simplify

Ballistic Particle

Clear[L,x]

The Lagrangian reads

L=(1/2)m ((x'[t])^2)-m g x[t];

DSolve[{x''[t]+g==0,x[t1]==x1,x[t2]==x2},x[t],t]//Simplify

Series[((-g (t-t1) (t-t2) (t1-t2)+2 (-t2 x1+t (x1-x2)+t1 x2))/(2 (t1-t2))),{t,0,2}]//Normal

-((g (t^2))/2)+((t (g (t1^2)-g (t2^2)+2 x1-2 x2))/(2 (t1-t2)))+((-g (t1^2) t2+g t1 (t2^2)-2 t2 x1+2 t1 x2)/(2 (t1-t2)))==-((g (t^2))/2)+(((x2-x1)/(t2-t1))+(1/2)g(t1+t2))t+(((x1+(1/2)g (t1^2))t2-(x2+(1/2)g (t2^2))t1)/(t2-t1))//Simplify

x[t_]:=-((g (t^2))/2)+(((x2-x1)/(t2-t1))+(1/2)g(t1+t2))t+(((x1+(1/2)g (t1^2))t2-(x2+(1/2)g (t2^2))t1)/(t2-t1))

x''[t]+g ==0//Simplify
x[t1]==x1//Simplify
x[t2]==x2//Simplify

(∫_t1^t2)L\[DifferentialD]t//Simplify

Series[%,{g,0,2}]//Normal

((m ((g^2) (((t1-t2))^4)-12 (((x1-x2))^2)+12 g (((t1-t2))^2) (x1+x2)))/(24 (t1-t2)))==(1/24) (g^2) m (((t1-t2))^3)-((m (((x1-x2))^2))/(2 (t1-t2)))+(1/2) g m (t1-t2) (x1+x2)//Simplify

SBallistic[x1_,t1_,x2_,t2_]:=((m (((x2-x1))^2))/(2 (t2-t1)))-(1/2) g m (t2-t1) (x1+x2)-(1/24) (g^2) m (((t2-t1))^3)

Free Particle Revisited

Clear[x]

x[t_]:=x1+((x2-x1)/(t2-t1))(t-t1)
p[t_]:=m x'[t]

p1=p[t1]
p2=p[t2]

p1==-D[SFree[x1,t1,x2,t2],x1]
p2==+D[SFree[x1,t1,x2,t2],x2]

(1/(2m))((D[SFree[x1,t1,x2,t2],x1])^2)-D[SFree[x1,t1,x2,t2],t1]//Simplify

(1/(2m))((D[SFree[x1,t1,x2,t2],x2])^2)+D[SFree[x1,t1,x2,t2],t2]//Simplify

Harmonic Oscillator Revisited

Clear[x]

x[t_]:=((x1 Sin[(t2-t) ω]+x2 Sin[(t-t1) ω])/(Sin[ω(t2-t1)]))
p[t_]:=m x'[t]

p1=p[t1]
p2=p[t2]

p1==-D[SOscillator[x1,t1,x2,t2],x1]//Simplify
p2==+D[SOscillator[x1,t1,x2,t2],x2]//Simplify

(1/(2m))((D[SOscillator[x1,t1,x2,t2],x1])^2)+(1/2)m (ω^2)(x1^2)-D[SOscillator[x1,t1,x2,t2],t1]//Simplify

(1/(2m))((D[SOscillator[x1,t1,x2,t2],x2])^2)+(1/2)m (ω^2)(x2^2)+D[SOscillator[x1,t1,x2,t2],t2]//Simplify

Ballistic Particle Revisited

Clear[x]

x[t_]:=-((g (t^2))/2)+(((x2-x1)/(t2-t1))+(1/2)g(t1+t2))t+(((x1+(1/2)g (t1^2))t2-(x2+(1/2)g (t2^2))t1)/(t2-t1))
p[t_]:=m x'[t]

p1=p[t1]
p2=p[t2]

p1==-D[SBallistic[x1,t1,x2,t2],x1]//Simplify
p2==+D[SBallistic[x1,t1,x2,t2],x2]//Simplify

(1/(2m))((D[SBallistic[x1,t1,x2,t2],x1])^2)+m g x1-D[SBallistic[x1,t1,x2,t2],t1]//Simplify

(1/(2m))((D[SBallistic[x1,t1,x2,t2],x2])^2)+m g x2+D[SBallistic[x1,t1,x2,t2],t2]//Simplify